//测试需求树形菜单
var testReqLeftTreeRightMenu = new Ext.menu.Menu({
    // 控制右键菜单位置
    float: true,
    items: [{
        text: "生成测试计划",
        iconCls: 'leaf',
        icon: 'static/images/icons/fam/rss_go.png',
        handler: function () {
            // 当点击时隐藏右键菜单
            this.up("menu").hide();
            var item = testRequirementLeftTree.getSelectionModel().getSelected();// 得到被选择的行的数组.
            if (item.items[0].data.status != 3)
                Ext.Msg.alert("错误", "只能转换通过审核的节点！");
            else {
                chooseTestDesignStore.proxy.url = zuulUrl + '/' + testServiceName
                    + '/common/testDesign/project/transform/'
                    + testRunProject;
                chooseTestDesignStore.reload();
                testRequirementTransformToDesignForm.reset();
                testRequirementTransformToDesignForm.down('#testReqToDesignTitle')
                    .setValue(item.items[0].data.text);
                testRequirementTransformToDesignWin.show();
            }
        }
    }]
});

//测试计划树形菜单
var testDesignLeftTreeRightMenu = new Ext.menu.Menu({
    // 控制右键菜单位置
    float: true,
    items: [{
        text: "生成测试执行",
        iconCls: 'leaf',
        icon: 'static/images/icons/fam/rss_go.png',
        handler: function () {
            // 当点击时隐藏右键菜单
            this.up("menu").hide();
            var item = testDesignLeftTree.getSelectionModel().getSelected();// 得到被选择的行的数组.
            if (item.items[0].data.status != 3)
                Ext.Msg.alert("错误", "只能转换通过审核的节点！");
            else if (!item.items[0].data.leaf)
                Ext.Msg.alert("错误", "只能转换非主题文件夹！");
            else {
                chooseTestRunStore.proxy.url = zuulUrl + '/' + testServiceName
                    + '/common/testRun/project/transform/'
                    + testDesignProject;
                chooseTestRunStore.reload();
                testDesignTransformToRunForm.reset();
                testDesignTransformToRunForm.down('#testDesignToRunTitle')
                    .setValue(item.items[0].data.text);
                testDesignTransformToRunWin.show();
            }
        }
    }]
});